package com.aner.tester.scanner;

import org.springframework.core.type.filter.AnnotationTypeFilter;
import org.springframework.core.type.filter.TypeFilter;

import java.lang.annotation.Annotation;
import java.util.List;
import java.util.stream.Collectors;

/**
 * annotation filter
 * @author aner
 * @version 1.0
 * @date 2020/10/19 21:16
 */
public class FilterBuilder {
    public static TypeFilter build(Class<? extends Annotation> annotionType) {
        return new AnnotationTypeFilter(annotionType, false);
    }

    public static List<TypeFilter> build(List<Class<? extends Annotation>> annotionTypes) {
        return annotionTypes.stream().map(AnnotationTypeFilter::new).collect(Collectors.toList());
    }
}
